#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3f;

void solve()
{
    int n, k;
    cin >> n >> k;
    if (k & 1) cout << -1 << endl;
    else
    {
        vector a(n, vector<int>(n, 0));
        int x = 0;
        for (int i = 0; i < k / 2; i++)
        {
            a[x][x]++;
            x++;
        }
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++) cout << a[i][j];
            cout << endl;
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}